<template>
  <el-card class="router-box-card">
    <div slot="header" class="clearfix">
      <span class="card-title">评论和@</span>
      <el-button style="float: right; padding: 3px 0" type="text">清空所有消息</el-button>
    </div>
    <div class="card-content">
      <div class="msg-list">
        <div class="item-msg" v-for="(item, index) in msgList" :key="index">
          <div class="item-msg-left">
            <div class="avatar-box">
              <img :src="item.avatarUrl">
            </div>
            <div class="msg-info">
              <div class="nick-name-box">
                <span class="nick-name">{{item.nickName}}</span>
                <span class="tip">回复了你的评论</span>
              </div>
              <div class="msg-content">
                <span>{{item.content}}</span>
              </div>
            </div>
          </div>
          <div class="item-msg-right">
            <p class="time">{{item.time}}</p>
          </div>
        </div>
      </div>
    </div>
  </el-card>
</template>

<script>
export default {
  name: 'index',
  data(){
    return{
      msgList:[
        {
          avatarUrl: 'http://www.nefuswzl.top/img/yancy.eb852c2e.png',
          nickName: 'Yancy Zhang',
          content: '这是一条评论',
          time: '2022-11-8'
        },
        {
          avatarUrl: 'https://portrait.gitee.com/uploads/avatars/user/3054/9163010_kindnit_1621831142.png!avatar60',
          nickName: 'Kidint',
          content: '这是一条评论',
          time: '2022-11-8'
        },
        {
          avatarUrl: 'https://foruda.gitee.com/avatar/1667280663376789253/5504239_lds0826_1667280662.png!avatar30',
          nickName: '化身强盗',
          content: '这是一条评论',
          time: '2022-11-8'
        },
        {
          avatarUrl: 'http://www.nefuswzl.top/img/yancy.eb852c2e.png',
          nickName: 'Yancy Zhang',
          content: '评论测试',
          time: '2022-11-8'
        },
      ]
    }
  }
}
</script>

<style scoped>
.router-box-card{
  padding: 10px;
}

.card-title{
  font-size: 16px;
  font-weight: 600;
  color: #222226;
}
/*消息*/
.item-msg{
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f0f0f2;
  padding: 20px 0;
}

.item-msg-left{
  display: flex;
}

.avatar-box{
  margin-right: 10px;
}

.avatar-box img{
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.nick-name-box .nick-name{
  margin-right: 8px;
  color: #222226;
}

.nick-name-box .tip{
  color: #99a;
}

.msg-content{
  padding: 10px 0;
  color: #222226;
  font-weight: bolder;
}

.time{
  color: #99a;
}
</style>
